package org.unt.db;

import java.util.Iterator;
import java.util.List;

public class Table {

    private String name;
    private List cols;

    public Table(String name, List cols) {
        super();
        this.name = name;
        this.cols = cols;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List getCols() {
        return cols;
    }

    public void setCols(List cols) {
        this.cols = cols;
    }

    public String toString() {

        StringBuffer buffer = new StringBuffer(name + "\n");

        for (Iterator iterator = cols.iterator(); iterator.hasNext();) {
            Column column = (Column) iterator.next();
            buffer.append("\t" + column.toString() + "\n");
        }

        return buffer.toString();
    }
}
